var k=10000;
document.getElementById("btn").innerHTML ="金币："+k+"$";
var flag1=0,flag2=0,flag3=0,flag4=0,flag5=0;
var flagn=0;/*0商城，1仓库*/

function change_1()
{
	console.log("change_1");
	if(flag1==0)
	{
		var img1=document.getElementById("rabbit");
		img1.src="img/first.jpg";
		flag1=1;
	}
	else 
	{
		var img1=document.getElementById("rabbit");
		img1.src="img/rabbit.jpg";
		flag1=0;
	}
}
function change_2()
{
	if(flag2==0)
	{
		var img1=document.getElementById("rabbit");
		img1.src="img/second.jpg";
		flag2=1;
	}
	else
	{
		var img1=document.getElementById("rabbit");
		img1.src="img/rabbit.jpg";
		flag2=0;
	}
}
function change_3()
{
	if(flag3==0)
	{
		var img1=document.getElementById("rabbit");
		img1.src="img/third.jpg";
		flag3=1;
	}
	else
	{
		var img1=document.getElementById("rabbit");
		img1.src="img/rabbit.jpg";
		flag3=0;
	}
}
function change_4()
{
	if(flag4==0)
	{
		var img1=document.getElementById("rabbit");
		img1.src="img/fourth.jpg";
		flag4=1;
	}
	else
	{
		var img1=document.getElementById("rabbit");
		img1.src="img/rabbit.jpg";
		flag4=0;
	}
}
function change_5()
{
	if(flag5==0)
	{
		var img1=document.getElementById("rabbit");
		img1.style.width=150+"px";
		img1.style.height=150+"px";
		img1.src="img/fifth.jpg";
		flag5=1;
	}
	else
	{
		var img1=document.getElementById("rabbit");
		img1.src="img/rabbit.jpg";
		flag5=0;
	}
}
function assure(){
	/*if(flagn==0)
	{
		*/
		var r = confirm("您确定购买当前装备吗？")
			if (r == true) {
				if(flag1==1)
				{
					k=k-100;
					document.getElementById("btn").innerHTML ="金币："+k+"$";
				}
				else if(flag2==1)
				{
					k=k-200;
					document.getElementById("btn").innerHTML ="金币："+k+"$";
				}
				else if(flag3==1)
				{
					k=k-300;
					document.getElementById("btn").innerHTML ="金币："+k+"$";
				}
				else if(flag4==1)
				{
					k=k-400;
					document.getElementById("btn").innerHTML ="金币："+k+"$";
				}
				else if(flag5==1)
				{
					k=k-500;
					document.getElementById("btn").innerHTML ="金币："+k+"$";
				}
				var img1=document.getElementById("rabbit");
				img1.src="img/rabbit.jpg";
			}
/*	}
	else{
		var r = confirm("您确定保存当前装扮吗？")
		/*if (r == true) {
			//加入游戏元素代码，改变游戏主角
	}
	*/
			
}
function changeToS(){
	
	if(flagn==1){
		document.getElementById("storage").innerHTML="商城";
		var m1=document.getElementById("btn1");
		var m2=document.getElementById("btn2");
		var m3=document.getElementById("btn3");
		var m4=document.getElementById("btn4");
		var m5=document.getElementById("btn5");
		var f1=document.getElementById("zhuangbei_1");
		var f2=document.getElementById("zhuangbei_2");
		var f3=document.getElementById("zhuangbei_3");
		var f4=document.getElementById("zhuangbei_4");
		var f5=document.getElementById("zhuangbei_5");
		m1.style.display="none";
		m2.style.display="none";
		m3.style.display="none";
		m4.style.display="none";
		m5.style.display="none";
		if(flag1==1)
		{
			f1.style.display="block";
		}
		else
		{
			f1.style.display="none";
		}
		if(flag2==1)
		{
			f2.style.display="block";
		}
		else
		{
			f2.style.display="none";
		}
		if(flag3==1)
		{
			f3.style.display="block";
		}
		else
		{
			f3.style.display="none";
		}
		if(flag4==1)
		{
			f4.style.display="block";
		}
		else
		{
			f4.style.display="none";
		}
		if(flag5==1)
		{
			f5.style.display="block";
		}
		else
		{
			f5.style.display="none";
		}

		flagn=0;
		
	}
	else{
		document.getElementById("storage").innerHTML="仓库";
		var m1=document.getElementById("btn1");
		var m2=document.getElementById("btn2");
		var m3=document.getElementById("btn3");
		var m4=document.getElementById("btn4");
		var m5=document.getElementById("btn5");
		
		m1.style.display="block";
		m2.style.display="block";
		m3.style.display="block";
		m4.style.display="block";
		m5.style.display="block";
		
		var f1=document.getElementById("zhuangbei_1");
		var f2=document.getElementById("zhuangbei_2");
		var f3=document.getElementById("zhuangbei_3");
		var f4=document.getElementById("zhuangbei_4");
		var f5=document.getElementById("zhuangbei_5");
		f1.style.display="block";
		f2.style.display="block";
		f3.style.display="block";
		f4.style.display="block";
		f5.style.display="block";
		flagn=1;
	}
	
}